namespace Jumpton.SFA.Server.Entity
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Jumpton.Persistent;
    using System.Data;
    using System.Runtime.Serialization;


    [System.SerializableAttribute()]
    [Map("VISITS")]
    public class VISITS : ObjectRow
    {

        public VISITS()
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">DataTable 中的一行数据</param>
        /// <param name="objectTable">存储当前对象的数据表格</param>
        public VISITS(System.Data.DataRow dataRow, ObjectTable parent) :
            base(dataRow, parent)
        {
        }

        /// <summary>
        /// 供反序列化使用的构造函数
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected VISITS(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
            base(info, context)
        {
        }

        [Key("ID")]
        public decimal ID
        {
            get
            {
                return (System.Decimal)GetValue("ID");
            }
            set
            {
                SetValue("ID", value);
            }
        }

        [Field("USER_ID")]
        public decimal USERID
        {
            get
            {
                return (System.Decimal)GetValue("USERID");
            }
            set
            {
                SetValue("USERID", value);
            }
        }

        [Field("CUSTOMER_ID")]
        public decimal CUSTOMERID
        {
            get
            {
                return (System.Decimal)GetValue("CUSTOMERID");
            }
            set
            {
                SetValue("CUSTOMERID", value);
            }
        }

        [Field("START_TIME")]
        public decimal STARTTIME
        {
            get
            {
                return (System.Decimal)GetValue("STARTTIME");
            }
            set
            {
                SetValue("STARTTIME", value);
            }
        }

        [Field("STOP_TIME")]
        public decimal STOPTIME
        {
            get
            {
                return (System.Decimal)GetValue("STOPTIME");
            }
            set
            {
                SetValue("STOPTIME", value);
            }
        }

        [Field("Note")]
        public string Note
        {
            get
            {
                return (System.String)GetValue("Note");
            }
            set
            {
                SetValue("Note", value);
            }
        }

        [Field("DOMAIN_ID")]
        public decimal DOMAINID
        {
            get
            {
                return (System.Decimal)GetValue("DOMAINID");
            }
            set
            {
                SetValue("DOMAINID", value);
            }
        }

        [Field("LAST_UPDATER")]
        public string LAST_UPDATER
        {
            get
            {
                return (System.String)GetValue("LAST_UPDATER");
            }
            set
            {
                SetValue("LAST_UPDATER", value);
            }
        }

        [Field("LAST_UPDATE_TIME")]
        public decimal LAST_UPDATE_TIME
        {
            get
            {
                return (System.Decimal)GetValue("LAST_UPDATE_TIME");
            }
            set
            {
                SetValue("LAST_UPDATE_TIME", value);
            }
        }

        [Field("VISIT_TYPE")]
        public string VISITTYPE
        {
            get
            {
                return (System.String)GetValue("VISITTYPE");
            }
            set
            {
                SetValue("VISITTYPE", value);
            }
        }

        [Field("LONGITUDE")]
        public double LONGITUDE
        {
            get
            {
                return GetValue("LONGITUDE") == null ? 0 : (double)GetValue("LONGITUDE");
            }
            set
            {
                SetValue("LONGITUDE", value);
            }
        }

        [Field("LATITUDE")]
        public double LATITUDE
        {
            get
            {
                return GetValue("LATITUDE") == null ? 0 : (double)GetValue("LATITUDE");
            }
            set
            {
                SetValue("LATITUDE", value);
            }
        }

        [Field("org_id")]
        public int orgid
        {
            get
            {
                return (System.Int32)GetValue("orgid");
            }
            set
            {
                SetValue("orgid", value);
            }
        }

        [Field("person_id")]
        public decimal personid
        {
            get
            {
                return (System.Decimal)GetValue("personid");
            }
            set
            {
                SetValue("personid", value);
            }
        }

        [Field("OUTLINE")]
        public bool OUTLINE
        {
            get
            {
                return (System.Boolean)GetValue("OUTLINE");
            }
            set
            {
                SetValue("OUTLINE", value);
            }
        }

        [Field("STATUS")]
        public string STATUS
        {
            get
            {
                return (System.String)GetValue("STATUS");
            }
            set
            {
                SetValue("STATUS", value);
            }
        }

        [Field("SEQUENCE")]
        public int SEQUENCE
        {
            get
            {
                try
                {
                    return (System.Int32)GetValue("SEQUENCE");
                }
                catch
                {
                    return 0;
                }
            }
            set
            {
                SetValue("SEQUENCE", value);
            }
        }
    }
}
